import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

import javax.xml.namespace.QName;

public class Client {
    public static void main(String[] args) throws Exception{
        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
        org.apache.cxf.endpoint.Client client = dcf.createClient("http://localhost:8080/userService?wsdl");
        // namespace是命名空间，methodName是方法名
        QName name = new QName("http://unknown.namespace/", "CXFHelloDengJL");
        Object[] objects = client.invoke(name, "3221003139");
        System.out.println(objects[0].toString());
//        System.out.println(objects[0].toString());
//        Service service = Service.create(url, qname);
//        IService iService = service.getPort(IService.class);
//        iService.hello("邓金玲");
    }
}
